import request from "@/utils/request";

// // 商家版  各种统计数据接口
// //首页右上角统计
// export function gethomePageTopRightData(query) {
//   return request({
//     url: "/merchant/statistics/num",
//     method: "get",
//     params: query,
//   });
// }
// //首页右下角统计
// export function gethomePageEchartsData(query) {
//   return request({
//     url: "/merchant/statistics/order",
//     method: "get",
//     params: query,
//   });
// }

let statisticsApi = {
  // 首页右上角统计
  gethomePageTopRightData(query) {
    return request({
      url: "/merchant/statistics/num",
      method: "get",
      params: query,
    });
  },
  //首页右下角统计
  gethomePageEchartsData(params) {
    return request({
      url: `/merchant/statistics/order`,
      method: "get",
      params,
    });
  },
  //商品管理 饼图统计
  otherGoodsPie(params) {
    return request({
      url: `/merchant/statistics/otherGoods`,
      method: "get",
      params,
    });
  },
  // 商品库存统计
  goodsNumbers(params){
    // /merchant/statistics/unsoldGoods
    return request({
      url: `/merchant/statistics/unsoldGoods`,
      method: "get",
      params,
    });
  },
  // 商品浏览量统计 /merchant/statistics/goodsBrowse
  goodsBrowse(params){
    // /merchant/statistics/unsoldGoods
    return request({
      url: `/merchant/statistics/goodsBrowse`,
      method: "get",
      params,
    });
  },
  // 支付订单统计
  payOrderStatistics(params){
    // /merchant/statistics/unsoldGoods
    return request({
      url: `/merchant/statistics/payOrder`,
      method: "get",
      params,
    });
  },
  // 完成订单统计 
  finishOrderStatistics(params){
    // /merchant/statistics/unsoldGoods
    return request({
      url: `/merchant/statistics/finishOrder`,
      method: "get",
      params,
    });
  },
  // 退款订单统计 
  afterOrderStatistics(params){
    // /merchant/statistics/unsoldGoods
    return request({
      url: `/merchant/statistics/afterOrder`,
      method: "get",
      params,
    });
  },
  // 渠道接口 推送量统计 
  channelApiStatistics(params){
    // /merchant/statistics/unsoldGoods
    return request({
      url: `/merchant/statistics/channel/statistics`,
      method: "get",
      params,
    });
  },
  // 渠道接口 消费统计 
  channelJifenStatistics(params){
    // /merchant/statistics/unsoldGoods
    return request({
      url: `/merchant/statistics/channel/xf`,
      method: "get",
      params,
    });
  },
};
export default statisticsApi;
